{include file="common/head_s"/}
<body>
<div class="rl_main">
<div class="fet_box box_pan layui-clear">  
    <div class="log_logo"><img src="{$sys.logo}" alt="{$sys.name}"></div>
    <form method="post" class="layui-form layui-form-pane">
        <div class="layui-form-item">
            <label for="L_mobile" class="layui-form-label">手  机  号</label>
            <div class="layui-input-block">
                <input type="text" id="L_mobile" name="mobile" lay-verify="required|phone" placeholder="请输入手机" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="L_vercode" class="layui-form-label">验  证  码</label>
            <div class="layui-input-block">
                <input type="text" id="L_vercode" name="code" lay-verify="required" placeholder="验证码" autocomplete="off" class="layui-input">
            </div>
            <div class="rtip"><button type="button" class="layui-btn layui-btn-xs layui-btn-primary" id="sentEmail">获取验证码</button></div>
        </div>
        <div class="layui-form-item">
            <label for="L_pass" class="layui-form-label">新 密 码</label>
            <div class="layui-input-block">
                <input type="password" id="L_pass" name="password" lay-verify="required" placeholder="请输入新密码" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="L_repass" class="layui-form-label">确认密码</label>
            <div class="layui-input-block">
                <input type="password" id="L_repass" name="password2" lay-verify="required" placeholder="请确认密码" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item fots">
            <a href="{:url('index')}" class="layui-btn layui-btn-primary">返回登录</a>
            <button type="button" class="layui-btn" lay-filter="sub" lay-submit>重置密码</button>
        </div>
    </form>
</div>
</div>

 
{include file="common/footer"/}
<script>

    layui.use('form', function () {
        var form = layui.form,$ = layui.jquery;
        $('#sentEmail').click(function () {
            var mobile = $('#L_mobile').val();
            var loading = layer.load(1, {shade: [0.1, '#fff']});
            $.post("{:url('sendEmail')}",{mobile:mobile},function(res){
                layer.close(loading);
                if(res.code > 0){
                    layer.msg(res.msg,{time:1000,icon:1});
                }else{
                    layer.msg(res.msg,{time:1000,icon:2});
                }
            });

        });
        // 登录提交监听
        form.on('submit(sub)', function (data) {
            var loading = layer.load(1, {shade: [0.1, '#fff']});
            $.post("{:url('forget')}",data.field,function(res){
                layer.close(loading);
                if(res.code > 0){
                    layer.msg(res.msg,{time:1800,icon:1},function(){
                        location.href = "{:url('index/index')}";
                    });
                }else{
                    layer.msg(res.msg,{time:1800,icon:2});
                }
            });
        })
    })
</script>
</body>
</html>